package calao.storage;

import calao.util.Cursor;

public class ObjectTable<T>
extends Table
{

	final RecordBinding<T> binding;
	
	public ObjectTable(String name, RecordBinding<T> binding) 
	{
		super(name);
		this.binding = binding;
	}
		
	Cursor<T> transform(final Cursor<Record> cursor)
	{
		return binding.transform(cursor);
	}

	/** Creates a new search on this table.
	 */
	public ObjectSearch<T> newObjectSearch()
	{
		return new ObjectSearch<T>(this);
	}

	public RecordBinding<T> getBinding()
	{
		return binding;
	}

}
